#include <QApplication>
#include <QDialog>

#include <QVBoxLayout>
#include <QHBoxLayout>


#include <QLabel>
#include <QTextEdit>
#include <QLineEdit>
#include <QCheckBox>
#include <QPushButton>
#include <QRadioButton>
#include <QDateEdit>
#include <QComboBox>

int main(int c, char ** v)
{
    QApplication app(c,v);

    QDialog d(NULL);

    QVBoxLayout *vl = new QVBoxLayout();
    QHBoxLayout *hl1 = new QHBoxLayout();
    QHBoxLayout *hl2 = new QHBoxLayout();
    QHBoxLayout *hl3 = new QHBoxLayout();
    QHBoxLayout *hl_comments = new QHBoxLayout();
    QHBoxLayout *hl_phone = new QHBoxLayout();
    QHBoxLayout *hl_email = new QHBoxLayout();

    hl1 -> addWidget(new QLabel("User name", &d));
    hl1 -> addItem(new QSpacerItem(10, 10, QSizePolicy::Minimum));
    hl1 -> addWidget(new QLineEdit(&d));

    hl2 -> addWidget(new QLabel("Sex", &d));
    hl2 -> addItem(new QSpacerItem(10, 10, QSizePolicy::Minimum));
    hl2 -> addWidget(new QRadioButton("M",&d));
    hl2 -> addWidget(new QRadioButton("F",&d));

    hl3 -> addWidget(new QLabel("Birth date", &d));
    hl3 -> addItem(new QSpacerItem(10, 10, QSizePolicy::Minimum));
    hl3 -> addWidget(new QDateEdit(QDate::currentDate(), &d));

    hl_phone -> addWidget(new QLabel("Phone", &d));
    hl_phone -> addItem(new QSpacerItem(10, 10, QSizePolicy::Minimum));
    hl_phone -> addWidget(new QLineEdit(&d));

    QComboBox * cb = new QComboBox(&d);
    cb -> addItem("", 0);
    cb -> addItem("gmail.com", 1);
    cb -> addItem("mail.ru", 2);
    cb -> addItem("inbox.ru", 3);
    cb -> addItem("list.ru", 4);
    cb -> addItem("yandex.ru", 5);

    hl_email -> addWidget(new QLabel("email", &d));
    hl_email -> addItem(new QSpacerItem(10, 10, QSizePolicy::Minimum));
    hl_email -> addWidget(new QLineEdit(&d));
    hl_email -> addWidget(new QLabel("@", &d));
    hl_email -> addWidget(cb);

    hl_comments -> addWidget(new QLabel("Comments", &d));
    hl_comments -> addItem(new QSpacerItem(10, 10, QSizePolicy::Minimum));
    hl_comments -> addWidget(new QTextEdit(&d));

    vl -> addItem(hl1);
    vl -> addItem(hl2);
    vl -> addItem(hl3);
    vl -> addItem(hl_phone);
    vl -> addItem(hl_email);
    vl -> addItem(hl_comments);

    d.setLayout(vl);
    d.show();

    return app.exec();
}
